const a = document.querySelectorAll('.a')

const dot = document.querySelectorAll('.a i')
for (let i = 0; i < a.length; i++) {
    a[i].addEventListener('click',function(){
        document.querySelector('.a.active').classList.remove('active')
        this.classList.add('active')
        //被点击的下标是i
        document.querySelector('.show').classList.remove('show')
        dot[i].classList.add('show')
    })
    a[0].classList.add('active')
    dot[0].classList.add('show')
}
